#include "commonpage.h"
#include "ui_commonpage.h"

#include <listitembox.h>

#include <QDebug>

CommonPage::CommonPage(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::CommonPage)
{
    ui->setupUi(this);
}

CommonPage::~CommonPage()
{
    delete ui;
}

void CommonPage::setCommonPageUI(const QString &text, const QString &imagePath)
{
    ui->PageTittle->setText(text);
    ui->musicImageLabel->setPixmap(QPixmap(imagePath));
    ui->musicImageLabel->setScaledContents(true);


    // 测试ListBoxItem对象放置到PageMusicList中
    ListItemBox* listItemBox = new ListItemBox(this);
    QListWidgetItem* item = new QListWidgetItem(ui->pageMusicList);
    item->setSizeHint(QSize(600,45));
    ui->pageMusicList-> setItemWidget(item,listItemBox);
}
